package com.zdya.bigloghandler;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;

public class ColFile {

    private static final int COL_NUM = 100000;

    public static void main(String[] args) throws IOException {

        try (BufferedReader br = Files.newBufferedReader(Paths.get("C:\\Users\\ZHY\\Desktop\\PurePro_111.log"), StandardCharsets.UTF_8);
             BufferedWriter bw = Files.newBufferedWriter(Paths.get("C:\\Users\\ZHY\\Desktop\\PurePro_COl.log"), StandardCharsets.UTF_8, StandardOpenOption.CREATE)) {
            int lineNum = 0;
            String buf = null;

            while ((buf = br.readLine()) != null) {
                if(buf.contains("19:54")){
                    bw.write(buf);
                    bw.newLine();
                }
                lineNum++;
            }
            System.out.println(lineNum);
        }

    }

}
